package com.zxy.supplier_system.server.controller

import com.zxy.supplier_system.server.service.DirectSaleOrderPaidRecordService
import org.springframework.web.bind.annotation.GetMapping
import org.springframework.web.bind.annotation.PathVariable
import org.springframework.web.bind.annotation.RequestMapping
import org.springframework.web.bind.annotation.RestController
import java.math.BigDecimal
import java.time.OffsetDateTime

@RequestMapping("directSaleClients/orders/{id}/paidRecords")
@RestController
class DirectSaleOrderPaidRecordController(
    private val directSaleOrderPaidRecordService: DirectSaleOrderPaidRecordService
) {

    @GetMapping
    fun getAllPaidRecords(@PathVariable id: Int):List<PaidRecordResponse>{
        return this.directSaleOrderPaidRecordService.getAllPaidRecords(id)
    }

    data class PaidRecordResponse(
        val id:Int,
        val fee: BigDecimal,
        val createdDateTime: OffsetDateTime,
    )

}